package com.dhcc.model;

import javax.persistence.*;

/**
 * Created by guorui on 2017/3/17.
 */
@Entity
@Table(name = "tb_test", schema = "test", catalog = "")
public class Test {
    private int testId;
    private String testTitle;
    private int totalScore;
    private int choiceNum;
    private int wdtNum;

    @Id
    @Column(name = "test_id", nullable = false)
    public int getTestId() {
        return testId;
    }

    public void setTestId(int testId) {
        this.testId = testId;
    }

    @Basic
    @Column(name = "test_title", nullable = false, length = 100)
    public String getTestTitle() {
        return testTitle;
    }

    public void setTestTitle(String testTitle) {
        this.testTitle = testTitle;
    }

    @Basic
    @Column(name = "total_score", nullable = false)
    public int getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(int totalScore) {
        this.totalScore = totalScore;
    }

    @Basic
    @Column(name = "choice_num", nullable = false)
    public int getChoiceNum() {
        return choiceNum;
    }

    public void setChoiceNum(int choiceNum) {
        this.choiceNum = choiceNum;
    }

    @Basic
    @Column(name = "wdt_num", nullable = false)
    public int getWdtNum() {
        return wdtNum;
    }

    public void setWdtNum(int wdtNum) {
        this.wdtNum = wdtNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Test test = (Test) o;

        if (testId != test.testId) return false;
        if (totalScore != test.totalScore) return false;
        if (choiceNum != test.choiceNum) return false;
        if (wdtNum != test.wdtNum) return false;
        if (testTitle != null ? !testTitle.equals(test.testTitle) : test.testTitle != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = testId;
        result = 31 * result + (testTitle != null ? testTitle.hashCode() : 0);
        result = 31 * result + totalScore;
        result = 31 * result + choiceNum;
        result = 31 * result + wdtNum;
        return result;
    }
}
